package com.chb.rpc;

import java.lang.reflect.Proxy;

/**
 * @description:
 * @author: CHB
 * @create: 2022-03-14 10:53
 **/
public class RpcProxy {


    public <T> T proxyClient(Class clazz, String host, Integer port){
        return (T)Proxy.newProxyInstance(
                clazz.getClassLoader(),
                new Class<?>[]{clazz},
                new RemoteInvocationHandler(host, port));
    }
}
